# -*- coding: utf-8 -*-
"""
Created on Fri Sep 13 23:45:36 2024

@author: Administrator
"""

from tkinter import *
#注意大小写
tk = Tk()

canvas= Canvas(tk,width=500,height=400,bd=0)
canvas.pack()

canvas.create_polygon(100,100,0,200,200,200, outline="red",fill="red")
canvas.create_rectangle(0,200,200,300,outline="gray",fill="green")

#必须加时间循环，否则窗口不会出现
tk.mainloop()